package com.lc;

import com.lc.demo.User;
import com.lc.proxy.DaoProxy;
import com.lc.demo.UserDAO;

import java.lang.reflect.Proxy;


public class Main {
    public static void main(String[] args) {
        UserDAO userDAO = (UserDAO) Proxy.newProxyInstance(UserDAO.class.getClassLoader(),
                new Class[]{UserDAO.class}, new DaoProxy());
        //List<User> users = userDAO.selectUsers();
        User user = userDAO.selectUser(8);
        System.out.println("res: " + user);
    }
}
